package com.zhy.learning.demo.gc;

import java.util.ArrayList;
import java.util.List;

public class GcTest1 {

    public static void main(String[] args) {
        List<Integer> list1 = new ArrayList<>();
        long start1 = System.currentTimeMillis();
        for (int i = 0; i < 10000000; i++) {
            list1.add(i);
        }
        System.out.println(System.currentTimeMillis() - start1);
        List<Integer> list2 = new ArrayList<>();
        long start2 = System.currentTimeMillis();
        for (int i = 10000000; i < 20000000; i++) {
            list2.add(i);
        }
        System.out.println(System.currentTimeMillis() - start2);
    }
}
